package com.outsource.framework.model.repository;

import java.util.List;

import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;

import com.outsource.framework.domain.Tadrelatepostion;

public interface TadRepository extends CrudRepository<Tadrelatepostion, Integer>, JpaSpecificationExecutor<Tadrelatepostion>{

	@Query(value="select info.adName,info.adLink,info.adContent,rpos.pic from t_ad_info as info,t_ad_postion as pos,t_ad_relate_postion as rpos where rpos.adId = info.id and rpos.postionId = pos.id and (pos.type = '2' and pos.status = '0');",nativeQuery = true)
	List<Object[]> getByAdAll();
	
}
